package org.example.myleet.p591;

import org.example.myleet.Utils.Assert;

public class Main {
    public static void main(String[] args) {
        Solution solution = new Solution();
        Assert.isTrue(solution.isValid("<DIV>This is the first line <![CDATA[<div>]]></DIV>"));
        Assert.isTrue(solution.isValid("<DIV>>>  ![cdata[]] <![CDATA[<div>]>]]>]]>>]</DIV>"));
        Assert.isTrue(solution.isValid("<DIV>>>  ![cdata[]] <![CDATA[<div>]]]>>]</DIV>"));
        Assert.isTrue(solution.isValid("<A><A>/A></A></A>"));
        Assert.isTrue(!solution.isValid("<A>  <B> </A>   </B>"));
        Assert.isTrue(!solution.isValid("<DIV>  div tag is not closed  <DIV>"));
        Assert.isTrue(!solution.isValid("<DIV>  unmatched <  </DIV>"));
        Assert.isTrue(!solution.isValid("<DIV> closed tags with invalid tag name  <b>123</b> </DIV>"));
        Assert.isTrue(!solution.isValid("<DIV> unmatched tags with invalid tag name  </1234567890> and <CDATA[[]]>  </DIV>"));
        Assert.isTrue(!solution.isValid("<DIV>  unmatched start tag <B>  and unmatched end tag </C>  </DIV>"));
        Assert.isTrue(!solution.isValid("</DIV>"));
        Assert.isTrue(!solution.isValid("<![CDATA[wahaha]]]><![CDATA[]> wahaha]]>"));
        Assert.isTrue(!solution.isValid("<A></A><B></B>"));
        Assert.isTrue(!solution.isValid("<DIV><></></DIV>"));
        Assert.isTrue(!solution.isValid("<AAAAAAAAAA></AAAAAAAAAA>"));
    }
}
